package com.hadron.media.slideshow 
{
	import com.hadron.media.slideshow.enum.SlideshowStatus;
	import com.hadron.media.slideshow.items.ISlideshowItem;
	import temple.data.collections.ICollection;
	import temple.data.loader.preload.IPreloadable;
	import temple.data.xml.IXMLParsable;
	import temple.debug.IDebuggable;
	import temple.status.IHasStatus;
	import temple.ui.IDisplayObjectContainer;
	import temple.ui.IHasBackground;
	
	
	/** dispatched when item completes it's transitionIn */
	[Event(name = "itemInComplete", type = "com.hadron.media.slideshow.events.SlideshowEvent")]
	/** dispatched when item out completes it's transitionOut */
	[Event(name = "itemOutComplete", type = "com.hadron.media.slideshow.events.SlideshowEvent")]
	/** dispatched when current item changes */
	[Event(name = "onItemChange", type = "com.hadron.media.slideshow.events.SlideshowEvent")]
	/** dispatched when current item changes */
	[Event(name = "onItemsLoadComplete", type = "com.hadron.media.slideshow.events.SlideshowEvent")]
	/** dispatched when slideshow status changes */
	[Event(name = "onStatusChange", type = "com.hadron.media.slideshow.events.SlideshowEvent")]
	
	/**
	 * @author Hadron
	 */
	public interface ISlideshow extends IDebuggable,
								 IPreloadable,
								 IDisplayObjectContainer
								 
	{
		/**
		 * determines if slideshow will start automatically 
		 * after loading process finishes
		 */
		function get autoPlay():Boolean;
		function set autoPlay(value:Boolean):void;
		/**
		 * determines if slideshow will load its items automatically
		 */
		function get autoLoad():Boolean;
		function set autoLoad(value:Boolean):void;
		/**
		 * how long assets will be displayed [sec]
		 */
		function get displayTime():Number;
		function set displayTime(value:Number):void;
		/**
		 * how long assets will fade in [sec]
		 */
		function get fadeTime():Number;
		function set fadeTime(value:Number):void;
		/**
		 * currently displayed item index in items array
		 */
		function get currentIndex():uint;
		function set currentIndex(value:uint):void;
		/**
		 * xmlURL value - to automate loading process and variables instantiation
		 */
		function get xmlURL():String;
		function set xmlURL(value:String):void;
		/**
		 * Collection of ISlideshowItem set to display
		 */
		function get items():ICollection;
		/**
		 * Amount of items in items collections
		 */
		function get numItems():uint;
		
		function start(startIndex:uint = 0):void;
		function stop():void;
		/**
		 * cleans all contents resets private vars and stuff
		 */
		function cleanUp():void;
		/**
		 * Shows slideshow item at given index
		 * @param	index index value to be shown
		 * @param useItemTransition determines whether to use item's transition or not
		 * @return Returns item if such exists in items collection
		 */
		function showItemAt(index:uint, useItemTransition:Boolean = true):ISlideshowItem;
		/**
		 * @param	url URL of asset
		 * @param   useItemTransition If you don't want this specific item to use its transition behavior - set ite to false
		 * @return Returns slideshow item if such exist in items collection - otherwise null - none action taken
		 */
		function showItemByURL(url:String, useItemTransition:Boolean = true):ISlideshowItem;
		/**
		 * starts loading assets when autoLoad property is set to false
		 */
		function load():void;
		/**
		 * returns status of slideshow component
		 */
		function get status():SlideshowStatus;
	}
}